using MicroMsg.UI.Util;
using Microsoft.Phone.Controls;
using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class LoadingOverlay : UserControl
	{
		private ModeDialogHelper mDlgHelper;
		internal PerformanceProgressBar _performanceProgressBar;
		internal TextBlock InfoTxt;
		private bool _contentLoaded;
		public DlgReturnEvent ReturnEvent
		{
			set
			{
				this.mDlgHelper.DlgReturnCallBack = value;
			}
		}
		public LoadingOverlay(bool isEnableBackKeyPress = true)
		{
			this.InitializeComponent();
			this.mDlgHelper = new ModeDialogHelper(this, isEnableBackKeyPress, null, false);
		}
		public void Show(string loadMsg = null)
		{
			if (!string.IsNullOrEmpty(loadMsg))
			{
				this.InfoTxt.set_Text(loadMsg);
			}
			this.mDlgHelper.Show();
		}
		public void Hide(DlgReturnEventArg dlgReturnEventArg_0 = null)
		{
			this.mDlgHelper.Hide(dlgReturnEventArg_0);
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/Util/LoadingOverlay.xaml", 2));
			this._performanceProgressBar = (PerformanceProgressBar)base.FindName("_performanceProgressBar");
			this.InfoTxt = (TextBlock)base.FindName("InfoTxt");
		}
	}
}
